import React from "react";
import classNames from "classnames";

export interface CIconProps {
  name?: string;
  style?: React.CSSProperties;
  className?: string;
  onClick?: () => void;
}

export const Icon = (props: CIconProps) => {
  return (
    <svg
      className={classNames("icon", props.className)}
      aria-hidden="true"
      style={props.style ?? undefined}
      onClick={props.onClick ?? undefined}
    >
      <use xlinkHref={`#icon-${props.name}`}></use>
    </svg>
  );
};
